package com.huashi.dealer.modular.business.category.param;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 分类响应参数
 * 对应PHP的 /category/index 接口返回格式
 *
 * @author 谭陈强
 * @since 2025-07-30
 */
@Data
@Schema(description = "分类响应参数")
public class CategoryResponseParam {

    @Schema(description = "分类列表")
    private List<CategoryItem> list;

    @Schema(description = "分类详情")
    private CategoryItem category;

    @Data
    @Schema(description = "分类项")
    public static class CategoryItem {
        @Schema(description = "分类ID")
        private Long categoryId;

        @Schema(description = "分类名称")
        private String name;

        @Schema(description = "父分类ID")
        private Long parentId;

        @Schema(description = "排序")
        private Integer sort;

        @Schema(description = "分类图片ID")
        private Long imageId;

        @Schema(description = "小程序ID")
        private Long wxappId;

        @Schema(description = "分类类型")
        private Integer isType;

        @Schema(description = "商品类型")
        private Integer isGoodsType;

        @Schema(description = "创建时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime createTime;

        @Schema(description = "更新时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime updateTime;

        @Schema(description = "子分类列表")
        private List<CategoryItem> child;
    }
} 